Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate pallet-mixnet to umbrella crate #6986

Merged

Conversation

UtkarshBhardwaj007
Copy link
Contributor

@UtkarshBhardwaj007 UtkarshBhardwaj007 commented Dec 23, 2024

Description

Migrate pallet-mixnet to use umbrella crate whilst adding a few types and traits in the frame prelude that are used by other pallets as well.

Review Notes

  • This PR migrates pallet-mixnet to use the umbrella crate.
  • Note that some imports like use sp_application_crypto::RuntimeAppPublic; and imports from sp_mixnet::types:: have not been migrated to the umbrella crate as they are not used in any / many other places and are relevant only to the pallet-mixnet.
  • Transaction related helpers to submit transactions from frame-system have been added to the main prelude as they have usage across various pallets.
	pub use frame_system::offchain::*;
  • Exporting arithmetic module in the main prelude since this is used a lot throughout various pallets.
  • Nightly formatting has been applied using cargo fmt
  • Benchmarking dependencies have been removed frompalet-mixnet as there is no benchmarking.rs present for pallet-mixnet. For the same reason, "pallet-mixnet?/runtime-benchmarks" has been removed from umbrella/Cargo.toml.

@UtkarshBhardwaj007 UtkarshBhardwaj007 added R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet. labels Dec 23, 2024
@UtkarshBhardwaj007 UtkarshBhardwaj007 requested a review from a team as a code owner December 23, 2024 11:47
@UtkarshBhardwaj007
Copy link
Contributor Author

Part of #6504

@UtkarshBhardwaj007 UtkarshBhardwaj007 marked this pull request as draft December 23, 2024 11:55
@UtkarshBhardwaj007 UtkarshBhardwaj007 marked this pull request as ready for review December 23, 2024 12:14
substrate/frame/mixnet/src/lib.rs Outdated Show resolved Hide resolved
substrate/frame/mixnet/src/lib.rs Outdated Show resolved Hide resolved
substrate/frame/mixnet/src/lib.rs Show resolved Hide resolved
substrate/frame/mixnet/src/lib.rs Outdated Show resolved Hide resolved
substrate/frame/src/lib.rs Show resolved Hide resolved
@paritytech-review-bot paritytech-review-bot bot requested a review from a team December 24, 2024 21:40
@@ -168,12 +163,9 @@ fn twox<BlockNumber: UniqueSaturatedInto<u64>>(
// The pallet
////////////////////////////////////////////////////////////////////////////////

#[frame_support::pallet(dev_mode)]
#[frame::pallet(dev_mode)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dev_mode is not really good for production as well 🙈 not in scope for now, but should be removed later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, will have to dig in the code to understand why but we could create an issue for it if there's isn't one already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this is just because I never got around to adding weights.

@github-actions github-actions bot requested a review from kianenigma December 31, 2024 15:06
Copy link

Review required! Latest push from author must always be reviewed

prdoc/pr_6986.prdoc Outdated Show resolved Hide resolved
@github-actions github-actions bot requested a review from ggwpez January 2, 2025 16:54
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot requested review from ggwpez and re-gius January 3, 2025 10:09
@UtkarshBhardwaj007 UtkarshBhardwaj007 added this pull request to the merge queue Jan 3, 2025
Merged via the queue into paritytech:master with commit f3ab385 Jan 3, 2025
199 of 203 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the pallet-mixet-migration branch January 3, 2025 11:14
dudo50 pushed a commit to paraspell-research/polkadot-sdk that referenced this pull request Jan 4, 2025
# Description

Migrate pallet-mixnet to use umbrella crate whilst adding a few types
and traits in the frame prelude that are used by other pallets as well.

## Review Notes

* This PR migrates `pallet-mixnet` to use the umbrella crate. 
* Note that some imports like `use
sp_application_crypto::RuntimeAppPublic;` and imports from
`sp_mixnet::types::` have not been migrated to the umbrella crate as
they are not used in any / many other places and are relevant only to
the `pallet-mixnet`.
* Transaction related helpers to submit transactions from `frame-system`
have been added to the main `prelude` as they have usage across various
pallets.
```Rust
	pub use frame_system::offchain::*;
```
* Exporting `arithmetic` module in the main `prelude` since this is used
a lot throughout various pallets.
* Nightly formatting has been applied using `cargo fmt`
* Benchmarking dependencies have been removed from`palet-mixnet` as
there is no benchmarking.rs present for `pallet-mixnet`. For the same
reason, `"pallet-mixnet?/runtime-benchmarks"` has been removed from
`umbrella/Cargo.toml`.

---------

Co-authored-by: Dónal Murray <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants